<div class="form-group">
	<label class="col-sm-4 control-label"><?= __('Id Captcha'); ?></label>
	<div class="col-sm-5">
		<img id='captcha' src="<?= $this->webroot; ?>Captchas/?name=<?php echo $name; ?>&rand=<?php echo rand();?>" alt="" />
	    <a href="javascript:void(0)" onclick="reload_captcha('<?php echo $name; ?>')">
	    	<span class="glyphicon glyphicon-refresh"></span>
	    </a>
		<?php echo $this->Form->input( 'captcha', array('label' => false, 'div' => false, 'class' => 'form-control' )); ?>
	</div>
</div>


<script type="text/javascript">
function reload_captcha($name)
{
    jQuery('#captcha').attr('src', '<?= $this->webroot; ?>Captchas/?name=<?php echo $name; ?>&rand=' + Math.random());
}
</script>